package com.applearning.appsware.triky;

import android.content.Intent;
import android.media.MediaPlayer;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.ImageView;

import java.util.Timer;
import java.util.TimerTask;

/**
 * Created by ${Javier} on ${22-02-2015}
 */
public class ActividadPresentacionTriky extends ActionBarActivity {



    //<editor-fold desc="Informacion sobre version y autor/es">

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.layout_presentacion_triky);
        android.support.v7.app.ActionBar actionBar= getSupportActionBar();
        actionBar.hide();

        ImageView logo =(ImageView)findViewById(R.id.ivLogoTriky);
        Animation anim = AnimationUtils.loadAnimation(this, R.anim.anim_presentacion_awc);
        anim.setFillAfter(true);
        logo.startAnimation(anim);
        /*
      */
        MediaPlayer mp = MediaPlayer.create(ActividadPresentacionTriky.this, R.raw.sonido);
        mp.start();
        TimerTask task = new TimerTask() {
            @Override
            public void run() {
                Intent intent = new Intent().setClass(ActividadPresentacionTriky.this,ActividadPrincipal.class);
                startActivity(intent);
                overridePendingTransition(R.anim.anim_zoomforward_in,R.anim.anim_zoomforward_out);
                finish();
            }
        };
        Timer timer = new Timer();
        long splashTime = 4000;
        timer.schedule(task, splashTime);

    }
}
